#!/usr/bin/env bash

while [[ -n $1 ]] 
do
    if [ -n "$2" ] ; then 
        para_tmp="$para_tmp $1"
    else
        para_tmp="$para_tmp \"$1\""
    fi
    shift
done

[ -n "$para_tmp" ] && para_tmp=${para_tmp# }

#exdir="-a -I --exclude-dir={node_modules,boost,CI,unittest,.svn,.git,build,vbuild,googletest,test,gtest,libc++} --exclude={*.swp,*.swo,*.js,*.tmp,*.o,*.iso,*.bin,*.exe,*.out,*.so,*.a} -i $para_tmp ."
exdir="-a -I --exclude-dir={node_modules,boost,CI,unittest,.svn,.git,build,vbuild,googletest,test,gtest,libc++} --exclude={*.swp,*.swo,,*.tmp,*.o,*.iso,*.bin,*.exe,*.out,*.so,*.a} -i $para_tmp ."

print_line()
{
    (for((i=0;i<80;++i)) do printf "-"; done; printf "\n"; ) 1>&2
}

echo "grep -rn $exdir" 1>&2
print_line

echo "grep -rn $exdir"
exit 0

